<template>
  <div class="search col">
    <form action="/">
      <van-search
        v-model="value"
        placeholder="请输入搜索关键词"
        show-action
        @search="onSearch"
        @cancel="onCancel"
      />
    </form>
    <div class="lines"></div>
    <template v-if="searching">
        <div class="title">
            <div class="line"></div>
            <div class="title_desc">历史搜索</div>
            <van-icon name="delete" style="margin:0 .2rem 0 auto" />
        </div>
        <div class="tags">
            <van-tag  >标签</van-tag>
            <van-tag  >标签</van-tag>
            <van-tag  >标签</van-tag>
        </div>
        <div style="height:.2rem"></div>
        <div class="title">
            <div class="line"></div>
            <div class="title_desc">热门搜索</div>
        </div>
        <div class="tags">
            <van-tag  >标签</van-tag>
            <van-tag  >标签</van-tag>
            <van-tag  >标签</van-tag>
        </div>
    </template>

    <template v-else>

    </template>
  </div>
</template>

<script>
export default {
    data(){
        return{
            searching:true
        }
    },
    methods:{
        onCancel(){
            this.searching = true;
        },
        onSearch(){

        }
    }
};
</script>

<style lang="less" scoped>

.title{
    width: 100%;
    display: flex;
    align-items: center;
    margin-top: .16rem;
    .line{
        width: 4px;
        height: .32rem;
        background-color: #3963bc;
        margin-left: .2rem;
    }
    .title_desc{
        font-size: .3rem;
        margin: 0 .2rem;
    }
}
.lines {
  width: 100%;
  height: 1px;
  background-color: #f4f7ff;
}
.tags{
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    margin:.2rem .16rem;
    .van-tag{
        margin-right: .2rem;
        background-color: #f5f5f5;
        color: #999;
    }
}
</style>